<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				padding: 0;
				margin: 0;
			}
			td{
				text-align: center;
			}

			
		</style>
	</head>
	<body>
		<table border= 10px cellspacing="0">
            <tr >
            	<th><img src="img/ZBKB9UI)$D30%25BZ1T_2WV)B.png" ></th>
            	<th colspan="3">购物简易计算器</th>
            </tr>
            <tr>
            	<td>第一个数</td>
            	<td colspan="3"><input type="text" id="num1" value="" /></td>
            </tr>
            <tr>
            	<td>第二个数</td>
            	<td colspan="3"><input type="text" id="num2" value="" /></td>
            </tr>
            <tr class="btn">
            	<td><input type="button" onclick="add()" value="+"/></td>
            	<td><input type="button" onclick="sbu()" value="-"/></td>
            	<td><input type="button" onclick="mul()" value="*"/></td>
            	<td><input type="button" onclick="div()" value="/"/></td>
            </tr>
            <tr>
            	<td>计算结果</td>
            	<td colspan="3"><input type="text" id="num3" value="" /></td>
            </tr>
			
			<script src="" type="text/javascript" charset="utf-8"></script>
			<script type="text/javascript">
				var result;
				function add(){
					var num1 = document.getElementById("num1").value;
					var num2 = document.getElementById("num2").value;
					result = Number(num1) + Number(num2);
					sent(result);
				}
				function sbu(){
					var num1 = document.getElementById("num1").value;
					var num2 = document.getElementById("num2").value;
					result = Number(num1) - Number(num2);
					sent(result);
				}
				function mul(){
					var num1 = document.getElementById("num1").value;
					var num2 = document.getElementById("num2").value;
					result = Number(num1) * Number(num2);
					sent(result);
				}
				function div(){
					var num1 = document.getElementById("num1").value;
					var num2 = document.getElementById("num2").value;
					result = Number(num1) / Number(num2);
					sent(result);
				}
				function sent(re){
					// document.getElementsById("num3").value = result;
					document.getElementById("num3").value = re;
				}
				
			</script>
		</table>

	</body>
</html>
